// user/pages/userbook/userbook.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    height:wx.getSystemInfoSync().windowHeight-20,
    books:[{
      times:"20230901 231321"
    },
    {
      times:"20230901 231321"
    },
    {
      times:"20230901 231321"
    },
    {
      times:"20230901 231321"
    },
    {
      times:"20230901 231321"
    },
    {
      times:"20230901 231321"
    },
    {
      times:"20230901 231321"
    }
  ],
    colors:["Coral","CornflowerBlue","GoldenRod","HotPink","OldLace","Orchid","YellowGreen"]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {
    var that = this
    getApp().helper({
      url: getApp().globalData.urlpath + '/weixin/getbooks',
      data: {
        openid: getApp().globalData.uid
      },
      success(res) {
        if (res.data.ret == 'True') {
          that.setData({
              books:res.data.books
          })
        } else {
          // console.log(res.data);
          wx.showModal({
            title: '提示',
            content: '出现问题',
          })
        }
      },
      fail() {
        wx.showToast({
          title: '连接服务器失败',
          image: '/static/error.png',
          duration: 1500
        });
      }
    });
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})